//
//  THJProductCompanyCell.m
//  THJXHW
//
//  Created by 河南德艺 on 2017/11/4.
//  Copyright © 2017年 河南德艺. All rights reserved.
//

#import "THJProductCompanyCell.h"

@implementation THJProductCompanyCell
{
    NSInteger favFlag;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setContentWithDic:(NSDictionary*)dic{
    self.companyNameLab.text = dic[@"company"];
    self.zhuyingLab.text = [NSString stringWithFormat:@"主营:%@",dic[@"business"]];
    [self.logoImgV sd_setImageWithURL:[NSURL URLWithString:dic[@"clogo"]] placeholderImage:kGetImage(@"占位图")];
    if([dic[@"company_flag"] isEqual:@"0"]){
        self.rezhengImgV.image = kGetImage(@"非关于");
    }else{
        self.rezhengImgV.image = kGetImage(@"关于");
    }
    if([dic[@"alloy_flag"] isEqual:@"0"]){
        self.hjbImgV.image = kGetImage(@"hejinbaohui");
    }else{
        self.hjbImgV.image = kGetImage(@"hejin");
    }
    if([dic[@"fav_flag"] isEqual:@"0"]){
        favFlag = 0;
        [self.favImgV setBackgroundImage:kGetImage(@"收藏") forState:UIControlStateNormal];
    }else{
        favFlag = 1;
        [self.favImgV setBackgroundImage:kGetImage(@"收藏2") forState:UIControlStateNormal];
    }
}
//收藏
- (IBAction)favBtnAction:(id)sender {
    NSLog(@"收藏");
    if(favFlag){
        [self.favImgV setBackgroundImage:kGetImage(@"收藏") forState:UIControlStateNormal];
        favFlag = 0;
    }else{
        [self.favImgV setBackgroundImage:kGetImage(@"收藏2") forState:UIControlStateNormal];
        favFlag = 1;
    }
}
//关于公司
- (IBAction)getCompanyPage:(id)sender {
    [self.delegate getCompany];
}
@end
